package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface ItemTrialEnum {

    /**
     * 审核状态
     */
    @AllArgsConstructor
    @Getter
    enum AuditingStatus{
        AUDITING_NOT(0,"待审核"),
        AUDITING_PROCESS(1,"审核中"),
        AUDITING_PASS(2,"提交的审核通过"),
        AUDITING_REFUSE(3,"提交的审核拒绝")
        ;
        private Integer code;
        private String name;

        // 根据code获取名称
        public static String getValueByCode(Integer code) {
            for (ItemTrialEnum.AuditingStatus t : ItemTrialEnum.AuditingStatus.values()) {
                if (t.getCode()==code)
                    return t.getName();
            }
            return null;
        }

    }

    /**
     * 上架状态
     */
    @AllArgsConstructor
    @Getter
    enum  IsStacking{

        GROUNDING(1,"已上架"),
        UNGROUNDING(0,"未上架")
        ;
        private Integer code;
        private String name;
        // 根据code获取名称
        public static String getValueByCode(Integer code) {
            for (ItemTrialEnum.IsStacking t : ItemTrialEnum.IsStacking.values()) {
                if (t.getCode()==code)
                    return t.getName();
            }
            return null;
        }

    }

    /**
     * 该阶段审核通过与否
     */
    @AllArgsConstructor
    @Getter
    enum IsAudithingPass{
        PASS(1,"审核通过"),
        REFUSE(0,"审核拒绝")
        ;
        private Integer code;
        private String name;

        // 根据code获取名称
        public static String getValueByCode(Integer code) {
            for (ItemTrialEnum.IsAudithingPass t : ItemTrialEnum.IsAudithingPass.values()) {
                if (t.getCode()==code)
                    return t.getName();
            }
            return null;
        }

    }


    /**
     * 审核阶段
     */
    @AllArgsConstructor
    @Getter
    enum AuditingStage{
        CREATE(0,"创建"),
        FIRST_TRIAL(1,"初审"),
        RECHECK(2,"复审"),
        ;
        private Integer code;
        private String name;

        // 根据code获取名称
        public static String getValueByCode(Integer code) {
            for (AuditingStage t : values()) {
                if (t.getCode()==code)
                    return t.getName();
            }
            return null;
        }

    }
}
